package com.repair.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@TableName("repair_order")
public class RepairOrder {
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private Long userId;
    
    private Long repairmanId;
    
    private String applianceType;
    
    private String description;
    
    private String address;
    
    private Double latitude;
    
    private Double longitude;
    /**
     * 预约时间 yyyy-MM-dd HH:mm:ss
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime appointmentTime;
    
    private Integer status; // 0: 待接单, 1: 已接单, 2: 维修中, 3: 已完成, 4: 已取消
    
    private String repairResult;
    
    private Integer rating;
    
    private String comment;

    @TableField(exist = false)
    private String repairmanName;

    @TableField(exist = false)
    private String repairmanPhone;
    
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    
    @TableLogic
    private Integer deleted;
} 